<?php
declare(staict_types=1);

namespace app\admin\validate;

use think\Validate;

/**
 * 服务验证器
 * @package app\admin\validate
 */
class Service extends Validate
{
    // 定义验证规则
    protected $rule = [
        'id|ID' => 'require',
        'uid|用户ID' => 'require',
        'name|姓名' => 'require',
        'mobile|手机号' => 'require|mobile',
        'company|企业名称' => 'require',
        'province|省份' => 'require',
        'city|城市' => 'require',
        'area|地区' => 'require',
        'location|详细地址' => 'require',
        'home_time|上门时间' => 'require',
        'service_number|企业服务码' => 'require',
        'resource_number|社群编号' => 'require',
    ];

    // 定义验证提示
    protected $message = [
        'id.require' => 'ID必须',
        'uid.require' => '用户ID必须',
        'name.require' => '请输入姓名',
        'mobile.require' => '请输入手机号',
        'mobile.mobile' => '手机号格式不正确',
        'company.require' => '请输入企业名称',
        'province.require' => '请选择省份',
        'city.require' => '请选择城市',
        'area.require' => '请选择地区',
        'location.require' => '请输入详细地址',
        'home_time.require' => '请选择上门时间',
        'service_number.require' => '请输入企业服务码',
        'resource_number.require' => '请输入社群编号',
    ];
}
